package dobest.ray.com.jiongjiong.activity.HomePage;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import dobest.ray.com.jiongjiong.R;
import dobest.ray.com.jiongjiong.activity.BaseFragment;
import dobest.ray.com.jiongjiong.activity.HomePage.trend.EyeLoadToleranceActivity;
import dobest.ray.com.jiongjiong.activity.HomePage.trend.ProfessionalInterventionActivity;

/**
 * Created by Ray on 2016/3/16.
 * https://github.com/ray0807
 */
public class VisionTrendFragment extends BaseFragment implements View.OnClickListener {
    private TextView tv_professional_intervention;
    private LinearLayout ll_vision_can_do;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_vision_trend, container, false);
    }

    @Override
    protected void findViews(View view) {
        tv_professional_intervention = (TextView) view.findViewById(R.id.tv_professional_intervention);
        ll_vision_can_do = (LinearLayout) view.findViewById(R.id.ll_vision_can_do);
    }

    @Override
    protected void init() {

    }

    @Override
    protected void addListeners() {
        tv_professional_intervention.setOnClickListener(this);
        ll_vision_can_do.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent it = null;
        switch (v.getId()) {
            case R.id.tv_professional_intervention:
                break;
            case R.id.ll_vision_can_do:
                it = new Intent(mActivity, EyeLoadToleranceActivity.class);
                break;
        }
        if (it != null) {
            mActivity.startActivity(it);
        }
    }
}
